package org.example.project.bookstore.service;

import jakarta.servlet.http.HttpServletRequest;
import org.example.bean.Book;
import org.example.util.JsonResult;
import org.springframework.stereotype.Service;

/**
 * @Auther:Liu
 * @Testname:ShoppingCartService
 * @Date:2025/8/19 17:52
 */
@Service
public interface ShoppingCartService {
    //添加购物车
    JsonResult addBook(String bookId, String token);

    //查找个人购物车
    JsonResult findCartByUserId(HttpServletRequest request);

    //增删购物车书本数量
    JsonResult incrementOrDeleteBookNumber(String bookId,Integer number, String token);

    //增删购物车书本数量
    JsonResult updateBookNumber(String bookId,Integer number, String token);

    //删除单个购物车书本
    JsonResult deleteBook(String bookId, String token);

    //删除多个购物车书本
    JsonResult deleteMoreBook(String[] bookIds, String token);

    //备份
    void updateAllBook();
}
